#ifndef BEAN_H
#define BEAN_H

#define MAX_DEV_COUNT 20
#define MAX_TEPIG 3
#define MAX_TEPGE 10
#define MAX_TEPBD  2
#define MAX_UPS  2
#define MAX_ATS 2

#include <QString>
#include <QList>



typedef struct _DATAMAP
{
    QString devType;
    QString key;
    QString value;
    QString type;
}DataMap;


typedef struct _DEV_CONFIG
{
    QString dev_type;       //装置类型
    QString dev_name;       //装置名称
    QString datamap_path;       //datamap模板路径
    int maxCount;
    int num;
    int chn1;
    int chn2;
    QList<DataMap> datamaplist;
}DevConf;

typedef struct _YX
{
    int index;
    QString name;
    int display;
    int finvert;
}YX;

typedef struct _YC
{
    int index;
    QString name;
    QString unit;
    int display;
    int preci;
    float k_val;
    float b_val;
    float fup1;
    float fdown1;
    int fsave;
    int tsave;
    int tlazy;
}YC;



typedef struct DEV
{
    QString dev_type;       //装置类型
    QString dev_name;       //装置名称
    int devAddr;            //设备地址
    QList<YX> yxlist;
    QList<YC> yclist;
    QList<DataMap> maplist;     //datama
}DEV;

typedef struct _CHANNEL
{
    int fac_no;             //通道号
    QString com_name;       //串口名
    int baud;               //波特率
    QList<DEV> sysdev;      //通道设备
}Channel;

typedef struct _61850
{
    QString iedName;
}_61850;

typedef struct _BOXINFO
{
    QString dfip;
    QString ip1;
    QString netmask1;
    QString ip2;
    QString netmask2;
    bool isTelnet;
    bool isAutoRun;
    QString user;
    QString psw;
}BoxInfo;


typedef struct _LDINFO
{
    int chnIndex;
    int devIndex;
    QString ldname;
}LdInfo;

typedef struct _FILEBEN
{
    QString filename;
    QString remotePath;
}FileBean;

enum LogLevel
{
    NORMAL,
    WARN,
    ERROR
};

enum LogType
{
    ONE,
    FTP
};

typedef struct _RUNSTATE
{
    bool watchdog;
    bool scl_srvr_n;
    bool integratedpower;
}RunState;


typedef struct _PROJECT
{
  QString project_name;
  int baud;
  QString iedname;
  QString remark;
}Project;



#endif // BEAN_H
